package com.ln.dm1107.demo01;

import java.time.DayOfWeek;
import java.time.LocalDateTime;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/7 15:39
 */
public class Test02 {
    public static void main(String[] args) {
        //自定义日期时间
        LocalDateTime of = LocalDateTime.of(2001, 12, 13, 12, 13, 13);
        //获取当前日期时间
        LocalDateTime now = LocalDateTime.now();
        System.out.println(of);
        System.out.println(now);
        //星期
        DayOfWeek dayOfWeek = now.getDayOfWeek();
        System.out.println(dayOfWeek.getValue());

        int dayOfMonth = now.getDayOfMonth();
        System.out.println(dayOfMonth);
        //这一年第几天
        int dayOfYear = now.getDayOfYear();
        System.out.println(dayOfYear);
    }
}
